{% extends base %}

{% block head %}
<style type="text/css">
label {
    float: left;
    width: 80px;
    display: block;
}
.label-rest {
    float: left;
    width: calc(100% - 80px);
}
</style>
{% end %}

{% block body %}

{% init type = "md" %}
{% init heading = T("创建笔记") %}
<div class="card">
    <h3 class="card-title">{{heading}}</h3>
    {% if error != "" %}
        <pre class="col-md-12 error">
            {{error}}
        </pre>
    {% end %}

    <form method="POST" action="">
        <div class="row top-offset-1">
            <label>{{T("标题")}}</label> 
            <input type="text" class="mid-text" name="name" value="{{name}}" style="width:200px;"/>
        </div>
        
        {% if type != "group" %}
            <div class="row top-offset-1">
                <label>{{T("类型")}}</label>
                <select name="type" value="{{type}}">
                    {% for item in NOTE_TYPE_LIST %}
                        <option value="{{item.type}}">{{T(item.name)}}</option>
                    {% end %}
                </select>
            </div>

            <div class="row top-offset-1">
                <label>{{T("项目")}}</label>
                <select name="parent_id" value="{{parent_id}}">
                    {%for item in groups %}
                        <option value="{{item.id}}">{{item.name}}</option>
                    {% end %}
                </select>
            </div>
        {% end %}

        <div class="row top-offset-1">
            <label>&nbsp;</label>
            <button class="mid-text">{{T("创建")}}</button>
        </div>
    </form>
</div>
{% end %}

{% block aside %}
    {% include note/component/mod_aside.html %}
{% end %}
